package TTEST;

import java.awt.Color;
import java.awt.Font;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import org.dyno.visual.swing.layouts.Bilateral;
import org.dyno.visual.swing.layouts.Constraints;
import org.dyno.visual.swing.layouts.GroupLayout;
import org.dyno.visual.swing.layouts.Leading;
import org.dyno.visual.swing.layouts.Trailing;

import Files.File_;
import ch.ethz.ssh2.Session;

//VS4E -- DO NOT REMOVE THIS LINE!
public class LabWindow extends JInternalFrame {

	private static final long serialVersionUID = 1L;
	private JList jList0;
	private JScrollPane jScrollPane0;
	private JScrollPane jScrollPane1;
	private JTabbedPane jTabbedPane0;
	private JPanel jPanel0;
	private JCheckBox jCheckBox0;
	private JPanel jPanel1;
	private JPanel jj;
	private JCheckBoxR jCheckBox1;
	_ConnectionThread watek;
	Session ses;
	InputStream in;
	OutputStream out;
	String host,username;
	private JLabel jLabel0;
	private JTextField jTextField0;
	private JCheckBox jCheckBox2;
	private JComboBox jComboBox0;
	private JCheckBoxR jCheckBox3;
	private JCheckBoxR jCheckBox4;
	private JCheckBox jCheckBox5;
	public LabWindow(String a,String b){
		//new File(a+"a")
		DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
	   //get current date time with Date()
	   Date date = new Date();
	   System.out.println(dateFormat.format(date));
 
	   //get current date time with Calendar()
	   Calendar cal = Calendar.getInstance();
	   System.out.println(dateFormat.format(cal.getTime()));
		this.host=a;this.username=b;
	}
	public LabWindow(String h){
		
		String[] r=File_.common_map_labs.get(h).split(" ");
		setClosable(true);
		setMaximizable(false);
		String rightvalue=h;//convertIptoUseableString(r[2]);
		setTitle(rightvalue/*ightvalue*/);
		DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd HH_mm_ss");
		   Date date = new Date();
		   System.out.println(dateFormat.format(date));
		   Calendar cal = Calendar.getInstance();
		   System.out.println(dateFormat.format(cal.getTime()));
		   directory=new File_().getbasedirectory()+rightvalue+"-"+dateFormat.format(cal.getTime());
		   new File(directory).mkdir();
			initComponents();
			
			ct=new _ConnectionThread(this,getJTextArea0(),host=r[2],r[0],r[1]);
			ct.start();
	}
	String directory;
	public LabWindow() {
	DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd HH_mm_ss");
	   //get current date time with Date()
	   Date date = new Date();
	   System.out.println(dateFormat.format(date));
 
	   //get current date time with Calendar()
	   Calendar cal = Calendar.getInstance();
	   System.out.println(dateFormat.format(cal.getTime()));
	   new File("c:\\"+dateFormat.format(cal.getTime())).mkdir();
		initComponents();
		//ct=new _ConnectionThread(getJTextArea0(), "10.91.18.63", "omc","828--User");
		//ct.start();
	}
	

	private void initComponents() {
		setVisible(true);
		setLayout(new GroupLayout());
		add(getJTabbedPane0(), new Constraints(new Leading(13, 1228, 12, 12), new Bilateral(560, 12, 7)));
		add(getJLabel1(), new Constraints(new Leading(20, 10, 10), new Leading(545, 10, 10)));
		add(getJScrollPane1(), new Constraints(new Leading(11, 1522, 10, 10), new Leading(8, 510, 10, 10)));
		add(getJComboBox1(), new Constraints(new Leading(11, 1519, 10, 10), new Leading(517, 169, 169)));
		add(getJScrollPane0(), new Constraints(new Leading(1157, 250, 10, 10), new Leading(596, 135, 10, 10)));
		add(getJButton0(), new Constraints(new Leading(1258, 10, 10), new Leading(741, 12, 12)));
		add(getJLabel2(), new Constraints(new Leading(1159, 10, 10), new Leading(772, 10, 10)));
		add(getJTextField1(), new Constraints(new Leading(1162, 279, 10, 10), new Leading(790, 10, 10)));
		add(getJButton1(), new Constraints(new Leading(1452, 12, 12), new Trailing(12, 554, 554)));
		setSize(1560, 849);
	}
	private JPanel getJPanel5() {
		if (jPanel5 == null) {
			jPanel5 = new JPanel();
			jPanel5.setLayout(new GroupLayout());
			int x=9,y=11;int li=0;
			Map<String,String> checkbox1=TESTXML.e();
			for (String a:checkbox1.keySet()) {
				if ( a.length()<=4 ) {
					JCheckBox tymp=new JCheckBox();
					tymp.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent arg0) {
							System.out.println(((JCheckBox)arg0.getSource()).getText()+((JCheckBox)arg0.getSource()).isSelected());
						}
					});
					tymp.setSelected(checkbox1.get(a).equals("true")?true:false);
					if ( a.indexOf("-")!=-1 ) {
						Font f = new Font("Monospaced", Font.PLAIN, 12);String tymp_=a;
						tymp.setFont(f);tymp.setText(a+"W");
					}
					else
						tymp.setText(a);
					jPanel5.add(tymp, new Constraints(new Leading(x, 8, 8), new Leading(y, 8, 8)));
					if( a.indexOf("DN")!=-1 ) {
						if ( a.indexOf("*")!=-1) {
						JTextField txtfield=new JTextField();
						txtfield.addKeyListener(new KeyListener() {
							
							@Override
							public void keyTyped(KeyEvent arg0) {
								if(arg0.getKeyChar()==8)
								{
									if(rr.length()>=1)
									rr=rr.substring(0, rr.length()-1);
									else {
										rr="";
										System.out.println("PUSTO"); }
								}
								else
									rr+=arg0.getKeyChar();
								System.out.println(rr);
							}
							
							@Override
							public void keyReleased(KeyEvent arg0) {
								// TODO Auto-generated method stub
								
							}
							
							@Override
							public void keyPressed(KeyEvent arg0) {
								// TODO Auto-generated method stub
								
							}
						
						});
						jPanel5.add(txtfield, new Constraints(new Leading((x+100),200, 30, 30), new Leading(y, 30,30)));
						}
					}
					y+=20;++li;
					if ( li == 10) {
						x+=300;y=11;li=0;
					}
				}
				if ( a.length()>=4) {
					if ( !a.substring(0,4).equals("core")) {
						JCheckBox tymp=new JCheckBox();
						tymp.addActionListener(new ActionListener() {
							@Override
							public void actionPerformed(ActionEvent arg0) {
								System.out.println(((JCheckBox)arg0.getSource()).getText()+((JCheckBox)arg0.getSource()).isSelected());
							}
						});
						tymp.setSelected(checkbox1.get(a).equals("true")?true:false);
						if ( a.indexOf("-")!=-1 ) {
							Font f = new Font("Monospaced", Font.PLAIN, 12);
							tymp.setFont(f);tymp.setText(a.replace("-", ""));
						}
						else
							tymp.setText(a);
						jPanel5.add(tymp, new Constraints(new Leading(x, 8, 8), new Leading(y, 8, 8)));
						if( a.equals("feedbackLevel") ) {
							JComboBox feedbackLevel=new JComboBox();DefaultComboBoxModel dmodel=new DefaultComboBoxModel();
							String[] element=checkbox1.get(a).split("/");
							for (String elements:element) {
								dmodel.addElement(elements.replace("-",""));	
							}
							feedbackLevel.setModel(dmodel);
							jPanel5.add(feedbackLevel, new Constraints(new Leading((x+170),110, 8, 8), new Leading(y, 8, 8)));
						}
						y+=20;++li;
						if ( li == 10) {
							x+=300;y=11;li=0;
						}
					}}}}
			
		return jPanel5;
	}
	private JPanel getJPanel4() {
		if (jPanel4 == null) {
			jPanel4 = new JPanel();
			jPanel4.setLayout(new GroupLayout());
			List<String> mm=new TESTXML().cccc("Import_Export");int x=9,y=11;int li=0;
			System.out.println(mm);
			for (String hh: mm) {
				System.out.println(">>"+hh);
				JCheckBox tymp=new JCheckBox();tymp.setText(hh);
				jPanel4.add(tymp, new Constraints(new Leading(x, 8, 8), new Leading(y, 8, 8)));y+=20;++li;
				System.out.println("dodano");
				if ( li == 10) {
					x+=280;y=11;li=0;
				}
			}
		}
		return jPanel4;
	}
	JCheckBox return_(String a,JCheckBox xx) {
		Font c=new Font("Monospaced",Font.PLAIN,12);xx.setFont(c);xx.setText(a.replace("-", ""));
		return xx;
	}
	String rr="";
	Map<String,String> polecenia=new HashMap<String,String>();
	
		Map<String,String> standard=new HashMap<String, String>();
		Map<String, String> actual=new HashMap<String, String>();
		static Map<String,Map<String,String>> mm=new HashMap<String,Map<String,String>>();
		
		
		String command_="",standardparam=" -v";
		//"command -v
		public String sprawdz(){
			String com="";
			for (String k:actual.keySet()){
				com+=((standard.get(k)!=actual.get(k))?(k+"="+actual.get(k)):"")+" ";
			}
			return command_=com+standardparam;
		}
		//standard - rnccoscos = true
		//actual   - rnccoscos = true
	
	private JPanel getJPanel3() {
		if (jPanel3 == null) {
			jPanel3 = new JPanel();
			jPanel3.setLayout(new GroupLayout());
			int x=9,y=11;int li=0;standard=TESTXML.e();
			mm.put("UPLOAD", standard);
			Map<String,String> checkbox1=standard;//=TESTXML.e();
			for (String a:checkbox1.keySet()) {
				if ( a.length()<=4 ) {
					JCheckBox tymp=new JCheckBox();
					tymp.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent arg0) {
							sprawdz();
							System.out.println(((JCheckBox)arg0.getSource()).getText()+((JCheckBox)arg0.getSource()).isSelected());
						}
					});
					tymp.setSelected(checkbox1.get(a).equals("true")?true:false);
					if ( a.indexOf("-")!=-1 ) {
						Font f = new Font("Monospaced", Font.PLAIN, 12);String tymp_=a;
						tymp.setFont(f);tymp.setText(a+"W");
					}
					else
						tymp.setText(a);
					jPanel3.add(tymp, new Constraints(new Leading(x, 8, 8), new Leading(y, 8, 8)));
					if( a.indexOf("DN")!=-1 ) {
						if ( a.indexOf("*")!=-1) {
						JTextField txtfield=new JTextField();
						/*txtfield.addKeyListener(new KeyListener() {
							
							@Override
							public void keyTyped(KeyEvent arg0) {
								if(arg0.getKeyChar()==8)
								{
									if(rr.length()>=1)
									rr=rr.substring(0, rr.length()-1);
									else {
										rr="";
										System.out.println("PUSTO"); }
								}
								else
									rr+=arg0.getKeyChar();
								System.out.println(rr);
							}
							@Override
							public void keyReleased(KeyEvent arg0) {}
							@Override
							public void keyPressed(KeyEvent arg0) {}
						});*/
						jPanel3.add(txtfield, new Constraints(new Leading((x+100),200, 30, 30), new Leading(y, 30,30)));
						}
					}
					y+=20;++li;
					if ( li == 10) {
						x+=300;y=11;li=0;
					}
				}
				if ( a.length()>=4) {
					if ( !a.substring(0,4).equals("core")) {
						JCheckBox tymp=new JCheckBox();
						tymp.addActionListener(new ActionListener() {
							@Override
							public void actionPerformed(ActionEvent arg0) {
								System.out.println(((JCheckBox)arg0.getSource()).getText()+((JCheckBox)arg0.getSource()).isSelected());
							}
						});
						tymp.setSelected(checkbox1.get(a).equals("true")?true:false);
						if ( a.indexOf("-")!=-1 ) {
							Font f = new Font("Monospaced", Font.PLAIN, 12);
							tymp.setFont(f);tymp.setText(a.replace("-", ""));
						}
						else
							tymp.setText(a);
						jPanel3.add(tymp, new Constraints(new Leading(x, 8, 8), new Leading(y, 8, 8)));
						if( a.equals("feedbackLevel") ) {
							JComboBox feedbackLevel=new JComboBox();DefaultComboBoxModel dmodel=new DefaultComboBoxModel();
							String[] element=checkbox1.get(a).split("/");
							for (String elements:element) {
								dmodel.addElement(elements.replace("-",""));	
							}
							feedbackLevel.setModel(dmodel);
							jPanel3.add(feedbackLevel, new Constraints(new Leading((x+170),110, 8, 8), new Leading(y, 8, 8)));
						}
						y+=20;++li;
						if ( li == 10) {
							x+=300;y=11;li=0;
						}
					}}}}
			
		return jPanel3;
	}
	private JCheckBox getJCheckBox7() {
		if (jCheckBox7 == null) {
			jCheckBox7 = new JCheckBox();
			jCheckBox7.setSelected(true);
			jCheckBox7.setText("bssRNWContentInUse");
		}
		return jCheckBox7;
	}
	private JPanel getJPanel2() {
		if (jPanel2 == null) {
			jPanel2 = new JPanel();
			jPanel2.setVisible(false);
			jPanel2.setLayout(new GroupLayout());
		}
		return jPanel2;
	}
	private JCheckBox getJCheckBox6() {
		if (jCheckBox6 == null) {
			jCheckBox6 = new JCheckBox();
			jCheckBox6.setText("ipContentInUse");
		}
		return jCheckBox6;
	}
	private JRadioButton getJRadioButton1() {
		if (jRadioButton1 == null) {
			jRadioButton1 = new JRadioButton();
			jRadioButton1.setSelected(true);
			jRadioButton1.setText("objectLevel");
		}
		return jRadioButton1;
	}
	private JRadioButton getJRadioButton2() {
		if (jRadioButton2 == null) {
			jRadioButton2 = new JRadioButton();
			jRadioButton2.setSelected(true);
			jRadioButton2.setText("parameterLevel");
		}
		return jRadioButton2;
	}
	private JRadioButton getJRadioButton0() {
		if (jRadioButton0 == null) {
			jRadioButton0 = new JRadioButton();
			jRadioButton0.setSelected(true);		
			jRadioButton0.setText("summaryLevel");
		}
		return jRadioButton0;
	}
	private JLabel getJLabel3() {
		if (jLabel3 == null) {
			jLabel3 = new JLabel();
			jLabel3.setText("-feedbackLevel(Default is summaryLevel)");
		}
		return jLabel3;
	}
	private JComboBox getJComboBox1() {
		if (jComboBox1 == null) {
			jComboBox1 = new JComboBox();
			//jComboBox1.setModel(new DefaultComboBoxModel(new Object[] {}));
			jComboBox1.setDoubleBuffered(false);
			jComboBox1.setBorder(null);
			jComboBox1.addActionListener(new ActionListener() {
	
				public void actionPerformed(ActionEvent event) {
					jComboBox1ActionActionPerformed(event);
				}
			});
		}
		return jComboBox1;
	}
	private JButton getJButton1() {
		if (jButton1 == null) {
			jButton1 = new JButton();
			jButton1.setText("jButton1");
			jButton1.addMouseListener(new MouseAdapter() {
	
				public void mouseClicked(MouseEvent event) {
					jButton1MouseMouseClicked(event);
				}
			});
		}
		return jButton1;
	}
	private JTextField getJTextField1() {
		if (jTextField1 == null) {
			jTextField1 = new JTextField();
		}
		return jTextField1;
	}
	private JLabel getJLabel2() {
		if (jLabel2 == null) {
			jLabel2 = new JLabel();
			jLabel2.setText("Save last inserted command at command line as:");
		}
		return jLabel2;
	}
	DefaultListModel listModel;
	DefaultComboBoxModel listapolecen;
	void aa(){
		if(listapolecenwykonanych.isEmpty()){
			listapolecen.addElement("a");
		}
		else
		{
			
			//listapolecen.removeAllElements();
			for(String h:listapolecenwykonanych)
				listapolecen.addElement(h);
		}
	}
	private JList getJList0() {
		if (jList0 == null) {
			jList0 = new JList();
			listModel = new DefaultListModel();
			Map<String,String> c= new File_().readF(0);listModel.clear();
			if (!c.isEmpty()){
				for (Entry<String, String> entry :  c.entrySet()) {
					listModel.addElement(entry.getKey());
		        }
			}
			jList0.setModel(listModel);
			jList0.addMouseListener(new MouseAdapter() {
	
				public void mouseClicked(MouseEvent event) {
					jList0MouseMouseClicked(event);
				}
			});
		}
		return jList0;
	}
	private JTextArea getJTextArea0() {
		if (jTextArea0 == null) {
			jTextArea0 = new JTextArea();
			jTextArea0.setText("jTextArea0");
		}
		return jTextArea0;
	}
	private JButton getJButton0() {
		if (jButton0 == null) {
			jButton0 = new JButton();
			jButton0.setText("Run");jButton0.setName("run");
			jButton0.addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
										//LabWindow.command="tutaj\n";
										try{
											if (ct.td.getCommand()==""){
												//command
												String b=command+"\n";
												ct.td.out.write(b.getBytes(Charset.forName("UTF-8")));command="";setTitle(host);jLabel1.setText("");
										//ct.td.out.write("racclimx.sh -op Upload -DN PLMN-PLMN/MRBTS-755 -v\n".getBytes(Charset.forName("UTF-8")));
											} else{
												String t=ct.td.getCommand()+"\n";
												ct.td.out.write(t.getBytes(Charset.forName("UTF-8")));t="";
												setTitle(host);jLabel1.setText("");
											}
										}
										catch(Exception ee){};
							}
				});
		}
		return jButton0;
	}
	private JLabel getJLabel1() {
		if (jLabel1 == null) {
			jLabel1 = new JLabel();
			jLabel1.setText("");
		}
		return jLabel1;
	}
	List<String> listapolecenwykonanych=new ArrayList<String>();
	_ConnectionThread ct;
	private static JLabel jLabel1;
	static String command;
	static Map<String,Boolean> a=new HashMap<String,Boolean>();
	private JButton jButton0;
	private JTextArea jTextArea0;
	private JLabel jLabel2;
	private JTextField jTextField1;
	private JButton jButton1;
	private JComboBox jComboBox1;
	private JLabel jLabel3;
	private JRadioButton jRadioButton0;
	private JRadioButton jRadioButton2;
	private JRadioButton jRadioButton1;
	private JCheckBox jCheckBox6;
	private JPanel jPanel2;
	private JCheckBox jCheckBox7;
	private JPanel jPanel3;
	private JPanel jPanel4;
	private JPanel jPanel5;
	static String merge(){
		command="";
		for (String aa:a.keySet()) {
			System.out.println(">>"+aa);
			if(aa!=null)
				command+="-"+aa+"="+((a.get(aa)==true)?"true":"false")+" ";
		}
		return command;
	}
	static void showCommand(){
		jLabel1.setText(merge());
	}
	private JCheckBox getJCheckBox5() {
		if (jCheckBox5 == null) {
			jCheckBox5 = new JCheckBox();
			jCheckBox5.setText("-lteHwContentInUse");
			jCheckBox5.setSelected(false);
			a.put(jCheckBox5.getName(), false);
		}
		return jCheckBox5;
	}
	private JCheckBoxR getJCheckBox4() {
		if (jCheckBox4 == null) {
			jCheckBox4 = new JCheckBoxR("takeBTSFileBackups");
			jCheckBox4.setSelected(true);
			jCheckBox4.addActionListener(new ActionListenerForGenerateCommmands(jCheckBox4.getName()));
			jCheckBox4.setText("-takeBTSFileBackups");
			add_K_V(jCheckBox4.getName(),true);
		}
		return jCheckBox4;
	}
	void add_K_V(String name,Boolean value){
		a.put(name,value);
	}
	private JCheckBoxR getJCheckBox3() {
		if (jCheckBox3 == null) {
			jCheckBox3 = new JCheckBoxR();
			jCheckBox3.setText("-rncAxcContentInUse");
			jCheckBox3.setVisible(true);
			jCheckBox3.setVerifyInputWhenFocusTarget(true);
			jCheckBox3.setHorizontalAlignment(SwingConstants.LEADING);
			jCheckBox3.setOpaque(true);
			jCheckBox3.setFocusPainted(true);
			jCheckBox3.setContentAreaFilled(true);
			jCheckBox3.setFocusable(true);
			jCheckBox3.setEnabled(true);
			jCheckBox3.setIconTextGap(4);
			jCheckBox3.setAlignmentY(0.5f);
			jCheckBox3.setRequestFocusEnabled(true);
			jCheckBox3.setRolloverEnabled(true);
			jCheckBox3.addActionListener(new ActionListenerForGenerateCommmands(jCheckBox3.getName()));
		}
		return jCheckBox3;
	}
	private JComboBox getJComboBox0() {
		if (jComboBox0 == null) {
			jComboBox0 = new JComboBox();
			jComboBox0.setModel(new DefaultComboBoxModel(new Object[] { "summaryLevel","objectLevel","parameterLevel" }));
			jComboBox0.setDoubleBuffered(false);
			jComboBox0.setBorder(null);
		}
		return jComboBox0;
	}
	private JCheckBox getJCheckBox2() {
		if (jCheckBox2 == null) {
			jCheckBox2 = new JCheckBox();
			jCheckBox2.setSelected(true);
			jCheckBox2.setText("-feedbackLevel (Default is summaryLevel)");
		}
		return jCheckBox2;
	}
	private JTextField getJTextField0() {
		if (jTextField0 == null) {
			jTextField0 = new JTextField();
		}
		return jTextField0;
	}
	private JLabel getJLabel0() {
		if (jLabel0 == null) {
			jLabel0 = new JLabel();
			jLabel0.setText(" -DN : PLMN-PLMN/");
		}
		return jLabel0;
	}
	private JCheckBoxR getJCheckBox1() {
		if (jCheckBox1 == null) {
			jCheckBox1=new JCheckBoxR("TT1");
			Font f = new Font("Monospaced", Font.PLAIN, 8);
			jCheckBox1.setFont(f);
			jCheckBox1.setText("TT1");
			
			jCheckBox1.addActionListener(new ActionListenerForGenerateCommmands("1"));
		}
		return jCheckBox1;
	}
	private JPanel getJPanel1() {
		if (jPanel1 == null) {
			jPanel1 = new JPanel();
			jPanel1.setLayout(new GroupLayout());
			jPanel1.add(getJCheckBox3(), new Constraints(new Leading(9, 8, 8), new Leading(51, 8, 8)));
			jPanel1.add(getJCheckBox4(), new Constraints(new Leading(9, 8, 8), new Leading(71, 8, 8)));
			jPanel1.add(getJCheckBox5(), new Constraints(new Leading(9, 8, 8), new Leading(91, 8, 8)));
			jPanel1.add(getJTextField0(), new Constraints(new Leading(180, 180, 10, 10), new Leading(7, 12, 12)));
			jPanel1.add(getJLabel0(), new Constraints(new Leading(9, 111, 10, 10), new Leading(9, 10, 10)));
			jPanel1.add(getJCheckBox2(), new Constraints(new Leading(435, 264, 10, 10), new Leading(9, 12, 12)));
			jPanel1.add(getJLabel3(), new Constraints(new Leading(12, 12, 12), new Leading(33, 12, 12)));
			jPanel1.add(getJRadioButton0(), new Constraints(new Leading(251, 12, 12), new Leading(31, 12, 12)));
			jPanel1.add(getJRadioButton1(), new Constraints(new Leading(356, 10, 10), new Leading(31, 12, 12)));
			jPanel1.add(getJRadioButton2(), new Constraints(new Leading(444, 10, 10), new Leading(31, 12, 12)));
			jPanel1.add(getJComboBox0(), new Constraints(new Leading(581, 122, 10, 10), new Leading(35, 20, 12, 12)));
			jPanel1.add(getJCheckBox6(), new Constraints(new Leading(9, 12, 12), new Leading(115, 10, 10)));
			jPanel1.add(getJCheckBox7(), new Constraints(new Leading(9, 12, 12), new Leading(140, 10, 10)));
			jPanel1.addMouseListener(new MouseAdapter() {
	
				public void mouseClicked(MouseEvent event) {
					jPanel1MouseMouseClicked(event);
				}
			});
			jPanel1.addFocusListener(new FocusAdapter() {
	
				public void focusGained(FocusEvent event) {
					jPanel1FocusFocusGained(event);
				}
	
				public void focusLost(FocusEvent event) {
					jPanel1FocusFocusLost(event);
				}
			});
		}
		return jPanel1;
	}
	private JCheckBox getJCheckBox0() {
		if (jCheckBox0 == null) {
			jCheckBox0 = new JCheckBox();
			jCheckBox0.setText("new 0");
			Font f = new Font("Monospaced", Font.BOLD, 14);
			jCheckBox0.setFont(f);
		}
		return jCheckBox0;
	}
	private JPanel getJPanel0() {
		if (jPanel0 == null) {
			jPanel0 = new JPanel();
			jPanel0.setLayout(new GroupLayout());
			jPanel0.add(getJCheckBox0(), new Constraints(new Leading(10, 10, 10), new Leading(10, 10, 10)));
			jPanel0.add(getJCheckBox1(), new Constraints(new Leading(10, 8, 8), new Leading(38, 8, 8)));
		}
		return jPanel0;
	}
	private JPanel getFavorities(){
		if(jj==null)
		{
			jj=new JPanel();
			jj.setLayout(new GroupLayout());
		}
		return jj;
	}
	private JTabbedPane getJTabbedPane0() {
		if (jTabbedPane0 == null) {
			jTabbedPane0 = new JTabbedPane();
			jTabbedPane0.addTab("FavoriviesParameters", getJPanel0());
			jTabbedPane0.addTab("Upload", getJPanel1());
			jTabbedPane0.addTab("jPanel2", getJPanel2());
			jTabbedPane0.addTab("Upload", getJPanel3());
			jTabbedPane0.addTab("Import Export", getJPanel4());
			jTabbedPane0.addTab("Provision", getJPanel5());
			jTabbedPane0.addChangeListener(new ChangeListener() {
	
				public void stateChanged(ChangeEvent event) {
					if (jTabbedPane0.getTitleAt(jTabbedPane0.getSelectedIndex()) == "Upload")
						System.out.println("2'");
					else
						System.out.println("111");
				}
			});
		}
		return jTabbedPane0;
	}
	private JScrollPane getJScrollPane1() {
		if (jScrollPane1 == null) {
			jScrollPane1 = new JScrollPane();
			jScrollPane1.setViewportView(getJTextArea0());
		}
		return jScrollPane1;
	}
	private JScrollPane getJScrollPane0() {
		if (jScrollPane0 == null) {
			jScrollPane0 = new JScrollPane();
			jScrollPane0.setViewportView(getJList0());
		}
		return jScrollPane0;
	}
	private void jList0MouseMouseClicked(MouseEvent event) {
		if (event.getSource() instanceof JList){
		jLabel1.setText(((JList)event.getSource()).getSelectedValue().toString());
		jTextField0.setText(((JList)event.getSource()).getSelectedValue().toString());
		for (Entry<String, String> entry : File_.common_map_commands.entrySet()) {
			System.out.println(entry.getValue());
            if (entry.getKey().equals(((JList)event.getSource()).getSelectedValue().toString())){
            	jLabel1.setText(entry.getValue());
            	command=entry.getValue();
	}}
	}}
	public void cc(){
		Map<String,String> c= new File_().readF(0);listModel.clear();
		if (!c.isEmpty()){
			for (Entry<String, String> entry :  c.entrySet()) {
				listModel.addElement(entry.getKey());
	        }
		}
	}
	private void jButton1MouseMouseClicked(MouseEvent event) {
		new File_().addToMapLab(jTextField1.getText(), ct.td.getCommand(), 0);
		setTitle(host);
		Map<String,String> c= new File_().readF(0);listModel.clear();
		if (!c.isEmpty()){
			for (Entry<String, String> entry :  c.entrySet()) {
				listModel.addElement(entry.getKey());
	        }
		}
	}
	private void jComboBox1ActionActionPerformed(ActionEvent event) {
		JComboBox cc=(JComboBox)event.getSource();
		String b=(String)cc.getSelectedItem()+"\n";try{
		ct.td.out.write(b.getBytes(Charset.forName("UTF-8")));
		}
		catch(Exception e){};
	}
	private void jPanel1MouseMouseClicked(MouseEvent event) {
		System.out.println("UPLOAD");
	}
	private void jPanel1FocusFocusGained(FocusEvent event) {
		System.out.println("UPLOAD1");
	}
	private void jPanel1FocusFocusLost(FocusEvent event) {
		System.out.println("LOST UPLOAD");
	}

}
